package com.snake.springboot.custom.service.assemble.points;


import com.snake.springboot.custom.api.model.points.PointsRgeTempModel;
import com.snake.springboot.custom.api.request.points.PointsRgeTempQuery;
import com.snake.springboot.custom.dao.mybatis.entity.points.PointsRgeTempDO;
import org.snake.common.code.SerialNumberGeneratorFactory;
import org.snake.common.utils.PropertyUtils;

/**
 * <p>算力管理-算力充值模板
 * 类{@code PointsRgeTempAssemble} </br>
 * 创建时间2025/2/20 18:14
 * @author yangxt
 * @see
 */
public class PointsRgeTempAssemble {


    public static PointsRgeTempDO rgeTempAssemble(PointsRgeTempModel model, boolean isAdd) {
        if (isAdd) {
            model.setTempId(SerialNumberGeneratorFactory.buildId4Bean());
        }
        PointsRgeTempDO tempDO = new PointsRgeTempDO();
        PropertyUtils.copyProperties(tempDO,model);
        return tempDO;
    }

    public static PointsRgeTempDO rgeTempAssemble(PointsRgeTempQuery query) {
        PointsRgeTempDO tempDO = new PointsRgeTempDO();
        PropertyUtils.copyProperties(tempDO,query);
        return tempDO;
    }

    public static PointsRgeTempModel rgeTempModelAssemble(PointsRgeTempDO tempDO) {
        PointsRgeTempModel tempModel = new PointsRgeTempModel();
        PropertyUtils.copyProperties(tempModel,tempDO);
        return tempModel;
    }
}
